<template>
  <el-tree
    :data="nodes"
    node-key="id"
    :props="defaultProps"
    @node-click="handleNodeClick">
  </el-tree>
</template>

<script>
  export default {
    name: "Check",
    methods:{
      handleNodeClick(data){
        console.log(data)
      }
    },
    data(){
      return {
        defaultProps: {
          children: 'cityList',
          label: 'name'
        },
        nodes:[]
      }
    },
    created() {
      this.axios({
        method:"get",
        url:"/states"
      }).then((res)=>{
        this.nodes=res.data
      })
    }
  }
</script>

<style scoped>

</style>
